//
//  Status.swift
//  WB
//
//  Created by leador on 17/5/9.
//  Copyright © 2017年 袁满. All rights reserved.
//

import UIKit

class Status:NSObject {
    
    //MARK: ---属性---
    
    var created_at:String? //微博创建时间
    
    var source:String? //微博来源
    
    var text:String? //微博正文
    
    var mid:Int = 0 //微博的ID
    
    var user:User? //微博对应的属性
    
    var pic_urls:[[String:String]]? //微博的配图
    
    var retweeted_status:Status? //微博对应转发的微博

    //MARK: ---自定义构造函数---
    init(dict:[String:AnyObject]) {
        
        super.init()
        
        setValuesForKeys(dict)
        
        if let userDict = dict["user"] as? [String:AnyObject] {
            user = User(dict:userDict)
        }
        
        if let retweetedDict = dict["retweeted_status"] as? [String:AnyObject] {
            
            retweeted_status = Status(dict:retweetedDict)
            
        }
        
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
    }
    
}
